<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件的绑定和解绑</title>
</head>
<body>
    <input type="button" id="btn1" value="点我">
    <input type="button" id="btn2" value="解绑">
</body>
<script src="js/jquery-3.3.1.min.js"></script>
<script>
    //给btn1按钮绑定单击事件
     $("#btn1").on("click",function () {
         console.log("btn1的click事件触发了...");
     })
    $("#btn1").on("mouseout",function () {
        console.log("btn1的mouseoutk事件触发了...");
    })
    //通过btn2解绑btn1的单击事件
     $("#btn2").click(function () {
         //给btn1解绑事件
         $("#btn1").off("click mouseout");//解绑click和mouseout事件,事件名称用空格隔开
         $("#btn1").off();//解绑所有事件
     })
</script>
</html>